How to: Create a macro using macro recorder.
Solution:
Select 'Record Macro...' from the 'Tools' menu to type a name and a description for the macro and to start and stop recording.
1) Select the 'Tools' menu and select 'Record Macro'. (A submenu appears.)
2) Select 'Record New Macro...' from the submenu. (The Record New Macro dialog box appears.)
3) Type a name for the macro in the 'Macro Name' box.
the Macro Name box
NOTE: Excel automatically names a macro 'MacroX', where X is a sequential number assigned by Excel. However, it can be changed to a desired name. Macro names can contain up to 255 characters, letters, and numbers. Underscores can be used, but no spaces or other punctuation marks are allowed.
4) (Optional) Type the desired description for the macro in the 'Description' list box.
NOTE: By default, Excel displays the date the macro is created and the person who creates the macro in the 'Description' list box. Change the description as desired.
5) (Optional) Click 'Options' to expand the dialog box and to specify additional options:
a) Add the macro as a menu item in the 'Tools' menu:
1] Select the 'Menu Item on Tools Menu' check box in the 'Assign to' group.
2] Type the name of the new menu item in the 'Menu Item on Tools Menu' box.
the New Item on Tools Menu box
NOTE: Type an ampersand (&) before the character that is to be used as the access key for the new menu item. For example, type '&New Item' if the character 'N' is to be used as the access key. The added menu item will appear at the bottom of the 'Tools' menu.
b) Assign a shortcut key for the macro:
1] Select the 'Shortcut Key' check box.
2] Type a character in the 'Shortcut Key' box.
Adding a shortcut key
NOTE: By default, the resulting shortcut key is CTRL+ the typed character. To produce a different combination, hold down SHIFT while typing the character. The result will then be CTRL+SHIFT+ the typed character.
c) Select where the macro is to be stored from the 'Store In' group:
1] Select the 'Personal Macro Workbook' radio button to store the macro in PERSONAL.XLS.
NOTE: Macros stored in PERSONAL.XLS will become global macros and will apply to every Excel workbook.
2] Select the 'This Workbook' radio button to place the macro in the current workbook.
3] Select the 'New Workbook' radio button to place the macro in a new workbook.
d) Select the language in which the macro is written in the 'Language' group.
NOTE: The macro can be written in the Visual Basic or the MS Excel 4.0 Macro language.
6) Click 'OK' to start recording the macro.
7) Perform the commands and/or actions that need to be recorded.
8) Stop recording when the macro is complete:
a) Select the 'Tools' menu and select 'Record Macro'. (A submenu appears.)
b) Select 'Stop Recording' from the submenu.